import 'package:sainbainu/common/apis/feedback_api.dart';
import 'package:sainbainu/common/models/request/feedback_request.dart';
import 'package:sainbainu/common/models/request/pager_request.dart';
import 'package:sainbainu/common/models/response/feedback_response.dart';

class FeedbackRepository {
  final FeedbackApi _feedbackApi;

  FeedbackRepository(this._feedbackApi);

  /// 新增反馈
  Future<Map<String, dynamic>> add(FeedbackRequest feedbackRequest) async {
    var res = await _feedbackApi.add(feedbackRequest.toJson());
    return res;
  }

  /// 反馈列表
  Future<FeedbackResponse> list(PagerRequest pagerRequest) async {
    var res = await _feedbackApi.list(pagerRequest.toJson());
    return FeedbackResponse.fromJson(res);
  }
}
